package service;

import mapper.UserMapper;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import pojo.User;
import pojo.UserInfo;
import utils.SqlSessionFactoryUtils;

import java.util.List;

public class UserService {
    public User selectOne(String username , String password){
        SqlSessionFactory factory = SqlSessionFactoryUtils.getSqlSessionFactory();
        SqlSession sqlSession = factory.openSession();
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        User user = mapper.selectOne(username, password);
        sqlSession.close();
        return user;
    }
}
